package com.example.xd.hotfixdemo;

import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

public class Main2Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        findViewById(R.id.tv_create_dialog).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                createDialog();
            }
        });

        findViewById(R.id.add_test2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Test2 nnn = new Test2("nnn", 1, "三年级");
                Toast.makeText(Main2Activity.this, nnn.getName() + nnn.getGread(), Toast.LENGTH_SHORT).show();
            }
        });

    }

    private void createDialog() {
        AlertDialog alertDialog1 = new AlertDialog.Builder(this)
                .setTitle("热修复版本1.1")//标题
                .setMessage("弹框测试")//内容
                .setIcon(R.mipmap.ic_launcher)//图标
                .create();
        alertDialog1.show();
    }
}
